<template>
  <div class="">
    <el-table :data="Goodslist" border style="width: 100%">
      <el-table-column prop="brand_id" label="id" width="180"></el-table-column>
      <el-table-column
        :data="Goodslist"
        prop="name"
        label="商品名称"
        width="180"
      ></el-table-column>
      <el-table-column
        :data="Goodslist"
        prop="retail_price"
        label="售价"
        width="180"
      ></el-table-column>
      <el-table-column
        :data="Goodslist"
        prop="goods_number"
        label="库存"
        width="180"
      ></el-table-column>
      <el-table-column
        :data="Goodslist"
        prop="is_new"
        label="新品"
        width="180"
      ></el-table-column>
      <el-table-column :data="Goodslist" prop="is_hot" label="人气" width="180"></el-table-column>
      <el-table-column :data="Goodslist" prop="is_on_sale" label="上架" width="180"></el-table-column>
      <el-table-column :data="Goodslist" prop="sort_order" label="排序" width="180"></el-table-column>
      <el-table-column prop=" " label="操作" width="180">
           <el-button type="primary">编辑</el-button>
      </el-table-column>
    </el-table>
  </div>
</template>

 
<script>
import { GoodsApi } from "../../../../../request/api";
export default {
  data() {
    return {
      Goodslist: [],
      is_hot: 1,
    };
  },
  created() {
    console.log(456);
    GoodsApi({
      page: "1",
      name: "商品列表",
      size: "100",
    }).then((res) => {
      this.Goodslist = res.data.data;
      this.Goodslist.forEach((x) => {
        x.is_new = x.is_new === 0 ? "否" : "是";
         x.is_hot = x.is_hot === 0 ? "否" : "是";
         x.is_on_sale = x.is_on_sale === 0 ? "否" : "是";
      });
      console.log(this.Goodslist);
    });
  },
};
</script>
 
<style lang = "less" scoped>
</style>